<{include file="OA/cooperation/header.tpl"}>
	<section id="spread_one" class="column">
		
        <{if $alert_message}>
		<h4 class="alert_info"><{$alert_message}></h4>
        <{/if}>
		

		<article class="module width_3_quarter">
		<header>
			<h3 class="tabs_involved "><{if $method == 'add_contact_submit'}>添加新的联系人<{else}>修改联系人信息<{/if}></h3>
		</header>
		<form action="<{$method}>" method='post' id="add_apk">
		<div class="tab_container">
			<div id="tab1" class="tab_content">
			<table class="tablesorter apk-edit" cellspacing="0" cellpadding="0"> 
			<tbody> 
				<tr> 
   					<td><label class="l01">姓名</label><input type="text"  name="name" value="<{$contact.name}>"size="24" > 
					</td> 
					<td>
						<label class="l01">隶属公司</label>
                        <select name='corporation' class="corporation">
                            <{foreach from="$corpors" item=v}>
                                 <option value ="<{$v.id}>" <{if $contact.corporation == $v.id}> selected<{/if}>><{$v.name}></option>
                            <{/foreach}>
                        </select>
					</td> 
				</tr> 
				 <tr>
					<td>
                        <label class="l01">职位</label><input type="text" name="job" value="<{$contact.job}>"size="24">
                    </td>
					<td>
                        <label class="l01">所属部门</label><input type="text"  name="department" value="<{$contact.department}>"size="24">
                    </td>
                </tr>
				 <tr>
					<td>
                        <label class="l01">移动电话</label><input type="text" name="mobilephone" value="<{$contact.mobile}>"size="24">
                    </td>
					<td>
                        <label class="l01">固定电话</label><input type="text"  name="phone" value="<{$contact.phone}>"size="24">
                    </td>
                </tr>
				 <tr>
					<td>
                        <label class="l01">QQ</label><input type="text" name="qq" value="<{$contact.qq}>"size="24">
                    </td>
					<td>
                        <label class="l01">mail</label><input type="text" class="mail" name="mail" value="<{$contact.email}>" size="24">
                    </td>
                </tr>
				<tr>
					<td colspan="2" style="text-align:center">
						<input type="submit" class="bulid_action fw spread_submit" value="<{if $method == 'add_contact_submit'}>提交<{else}>修改<{/if}>">
					</td>
				</tr>
			</tbody> 
			</table>
			</div><!-- end of #tab1 -->
		</div><!-- end of .tab_container -->
		</form>	
		</article><!-- end of content manager article -->
		<div class="clear"></div>
	</section>
	<script>
		$('#add_apk').submit(function() {
			return confirm('是否确定此操作？');
		});
		$('.corporation').change(function () {
			var corporation_id  = $('.corporation').val();	
            var t   = new Date();
            var url = '/OA/cooperation/developer/get_apks/' + corporation_id + '?time=' + t.getTime();
            $.get(url, {} ,function (data) {
                    var html = '';
                    for (var i = 0; i < data.length; ++i)
                    {
                        var id = data[i].id;
                        var name = data[i].name;

                        html += name + '<input type="checkbox"  value="' + id + '" name="apk[]">';
                    }
					$('#apks-list').html(html);
            } , 'json');
		});
	</script>
<{include file="OA/cooperation/footer.tpl"}>
